home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global proc mayaHardwareSetCommonGlobalValue(
- string $global,
- string $value)
- {
- //
- // Description:
- // This procedure is called when the current renderer has changed from
- // some other renderer to the Maya Hardware renderer. It is called in the
- // process of copying common global values from the previous renderer to
- // the Maya Hardware renderer.
- // This procedure sets the value of the global specified by $global to the
- // value specified by $value.
- // For a complete list of valid values for the $global argument, and to
- // see how this procedure is used, see copyCommonRenderGlobals.mel.
- //
-
- int $intValue;
- float $floatValue;
-
- switch ($global)
- {
- case "animation":
- $intValue = $value;
- setAttr defaultRenderGlobals.animation $intValue;
- break;
- case "startFrame":
- $floatValue = $value;
- setAttr hardwareRenderGlobals.startFrame $floatValue;
- break;
- case "endFrame":
- $floatValue = $value;
- setAttr hardwareRenderGlobals.endFrame $floatValue;
- break;
- case "byFrame":
- $floatValue = $value;
- setAttr hardwareRenderGlobals.byFrame $floatValue;
- break;
- // These globals are not yet supported by the Maya Hardware Renderer
- //
- // case "framePadding":
- // break;
- case "renderableObjects":
- global string $hardwareRenderSelectedFlag;
- if ($value == "selected")
- {
- $hardwareRenderSelectedFlag = "-renderSelected";
- }
- else if ($value == "all")
- {
- $hardwareRenderSelectedFlag = "";
- }
- break;
- case "useCustomExtension":
- $intValue = $value;
- setAttr hardwareRenderGlobals.useCustomExtension $intValue;
- break;
- case "customExtension":
- setAttr -type "string" hardwareRenderGlobals.customExtension $value;
- break;
- case "renumberFramesUsing":
- $intValue = $value;
- setAttr hardwareRenderGlobals.modifyExtension $intValue;
- break;
- case "renumberStartFrame":
- $floatValue = $value;
- setAttr hardwareRenderGlobals.startExtension $floatValue;
- break;
- case "renumberByFrame":
- $floatValue = $value;
- setAttr hardwareRenderGlobals.byExtension $floatValue;
- break;
- // These globals are not yet supported by the Maya Hardware Renderer
- //
- // case "maintainWidthHeightRatio":
- // break;
- case "width":
- $intValue = $value;
- setAttr hardwareRenderGlobals.resolutionX $intValue;
- break;
- case "height":
- $intValue = $value;
- setAttr hardwareRenderGlobals.resolutionY $intValue;
- break;
- case "deviceAspectRatio":
- // We do not copy the device ratio. Only Pixel ratio is stored.
- break;
- case "pixelAspectRatio":
- $floatValue = $value;
- setAttr hardwareRenderGlobals.pixelAspectRatio $floatValue;
- break;
- case "enableDefaultLight":
- $intValue = $value;
- setAttr hardwareRenderGlobals.enableDefaultLight $intValue;
- // These globals are not yet supported by the Maya Hardware Renderer
- //
- // case "pluginFormat":
- // break;
- case "preRenderMel":
- if(!`about -evalVersion`)
- setAttr -type "string" hardwareRenderGlobals.preRenderMel $value;
- break;
- case "postRenderMel":
- if(!`about -evalVersion`)
- setAttr -type "string" hardwareRenderGlobals.postRenderMel $value;
- break;
- }
- }
-